/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.amuthu.indicator;

import org.amuthu.DataStore;

/**
 *
 * @author prabhu
 */
public abstract class AbstractIndicator extends Indicator
{
   private  IndicatorQuoteType quoteType;

   public IndicatorQuoteType getQuoteType()
   {
      return quoteType;
   }

   public void setQuoteType(IndicatorQuoteType quoteType)
   {
      this.quoteType = quoteType;
   }

   public AbstractIndicator(DataStore dataStore, int startOffset, IndicatorQuoteType quoteType)
   {
      super(dataStore, startOffset);
      this.quoteType = quoteType;
   }

   protected AbstractIndicator(DataStore dataStore, int startOffset)
   {
      super(dataStore, startOffset);
   }

   public double[] getInputArray(IndicatorQuoteType quoteType)
   {
      switch (quoteType)
      {
         case OPEN:
            return getDataStore().getOpen();
         case CLOSE:
            return getDataStore().getClose();
         case HIGH:
            return getDataStore().getHigh();
         case LOW:
            return getDataStore().getLow();
         case VOLUME:
            return getDataStore().getVolume();
         default:
            throw new AssertionError();
      }
   }

}
